<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新品有戏后台管理</title>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <script src="__STATIC__/boot/js/dropdown.js"></script>
    <style>
        th{
            text-align: center;
            vertical-align: middle!important;
        }
    </style>
</head>
<body>
{include file="base/header" /}
<div style="height: 1px"></div>
<div>
    <div style="width: 100px; float: left">
        <div style="float: left;width: 100px;" >
            <div class="dropdown">
                <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    订单模式
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
                    <li><a href="#" onclick="purchase()">一件代发订单</a></li>
                    <li><a href="#" >寄售订单</a></li>
                </ul>
            </div>
        </div>
    </div>
    <div style="float: left">
        <button class="layui-btn layui-btn-danger" onclick="index()">未完成订单</button>
    </div>
</div>
<div style="float: right; margin-top: 5px;margin-bottom: 5px" class="box-title ">
    <form class="form-inline" action="{:url('index/postpayment/index')}" method="get">
        <input type="text" name="ordernumber" value="<?php if(isset($ordernumber)) echo $ordernumber ?>" placeholder="订单号" class="form-control" id="exampleInputEmail3" >
        <input type="submit" class="btn btn-default" value="搜索"/>
        <input type="button" onclick="res()" value="全部显示" class="btn btn-default"/>
    </form>
</div>
<table class="layui-table">
    <colgroup>
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>订单号</th>
        <th>时间</th>
        <th>店名称</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {foreach $result as $val}
        <tr>
            <td>{$val.ordernumber}</td>
            <td>{$val.date}</td>
            <td>{$val.address}</td>
            <td style="width: 200px">
                <button onclick="detail({$val.ordernumber})" type="button" class="btn btn-primary btn-xs" >订单详情</button>
            </td>
        </tr>
    {/foreach}
    </tbody>
</table>
{$result->render()}
</body>
<script>
    //显示全部
    function res() {
        window.location.href = "{:url('index/postpayment/index')}";
    }
    //详情
    function detail(ordernumber) {
        window.location.href = "{:url('index/postpayment/detail')}?ordernumber="+ordernumber;
    }
    //一件代发订单
    function purchase() {
        window.location.href = "{:url('index/purchase/index')}"
    }
    //寄售订单
    function postPayment() {
        window.location.href = "{:url('index/postpayment/index')}"
    }
    //查看未完成订单
    function index() {
        window.location.href = "{:url('index/postpayment/index')}?status="+2;
    }
</script>
</html>